package com.briup.ch08;

import java.util.LinkedList;

public class Test4_LinkedList {
    public static void main(String[] args) {
        LinkedList<Integer> list=new LinkedList<>();
        list.push(10);
        list.push(20);
        list.push(30);
        System.out.println(list);
        list.addFirst(40);
        System.out.println(list);
        list.addLast(70);
        System.out.println(list);
        int v1=list.get(1);
        int v2=list.getFirst();
        int v3=list.getLast();
        System.out.println(v1+" "+v2+" "+v3);
        //pop获取元素
        int v4=list.pop();//一定要接收否则你不知道是哪个
        System.out.println(v4);
        System.out.println(list);
        int v5=list.removeLast();
        System.out.println(v5);
        System.out.println(list);
    }
}
